<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:rg="http://www.ruijie.com.cn/faces/ui"
	xmlns:c="http://java.sun.com/jstl/core"
	template="/layout/contentLayout.xhtml">
	<ui:param name="param_pageTitle" value="#{messages.samles_crud_party_userManagement}" />
	<ui:param name="param_navigationUrl" value="/luyuan/member/navigationUser.jsf" /> 
	<ui:param name="param_selectedMenuName" value="userMenu" /> 
	
	<ui:define name="road">
		#{messages.luyuan_member_listTable}
	</ui:define>
	
	<ui:define name="content">
		<!-- 弧形外观 -->
		<h:form id="userForm">
		<rg:areaPanel  > 
			<rg:areaPanel type="searchPanel" style="margin: 10px 0;">
				<rg:fieldSet column="auto" labelWidth="80px" >
					<rg:inputText id="sUserName" label="#{messages.luyuan_member_name}" value="#{memberAction.criteria.name}" />
					<rg:inputText id="sUserMobile" label="#{messages.luyuan_member_mobile}" value="#{memberAction.criteria.mobile}" />
                    <rg:selectOne id="sUserLevel" label="会员级别" value="#{memberAction.levelCriteria}"  enableEmpty="true"
                        converter="#{memberLevelConverter}" itemsProvider="#{memberLevelProvider}"/>
                    <rg:selectOne id="sMemberGroups" label="会员类别" value="#{memberAction.groupCriteria}"  enableEmpty="true"
                        converter="#{memberGroupConverter}" itemsProvider="#{memberGroupProvider}"/>
                    <rg:selectOne id="sLiveness" label="会员状态" value="#{memberAction.criteria.liveness}"  enableEmpty="true"
                        converter="#{memberLivenessConverter}" itemsProvider="#{memberLivenessProvider}"/>
                    <rg:selectOne id="sLoyalty" label="忠诚度" value="#{memberAction.criteria.loyalty}"  enableEmpty="true"
                        converter="#{memberLoyaltyConverter}" itemsProvider="#{memberLoyaltyProvider}"/>
					<rg:field label="最近活跃时间">
						<rg:datetime value="#{memberAction.startDate}" datePattern="yyyy-MM-dd" showApplyButton="false" />
						至
						<rg:datetime value="#{memberAction.endDate}" datePattern="yyyy-MM-dd" showApplyButton="false" />
					</rg:field>
					<rg:field>
					<h:commandButton styleClass="button" value="查询" />
					</rg:field>
				</rg:fieldSet>
			</rg:areaPanel>
			
			<h:panelGroup id="userTableGroup">
				<rg:table id="deviceTable"  value="#{memberAction.tableModel}" var="entity" columnConfigurable="disable">
                    <rg:column property="name" title="#{messages.luyuan_member_name}" />
                    <rg:column property="gender" title="性别" converter="#{genderConverter}"/>
                    <rg:column property="mobile" title="#{messages.luyuan_member_mobile}" sortable="false"/>
                    <rg:column property="memberIntegral.memberLevel" converter="#{memberLevelConverter}" title="会员等级" sortable="false" />
                    <rg:column property="memberIntegral.currentIntegral" title="可用积分" sortable="false" />
               		<rg:column property="memberGroups" title="会员类别" converter="#{memberGroupsConverter}" sortable="false"/>
               		<rg:column property="liveness" title="会员状态" messagePrefix="luyuan_crm_member_liveness_" converter="#{messageConverter}" sortable="false"/>
               		<rg:column property="loyalty" title="忠诚度" messagePrefix="luyuan_crm_member_loyalty_" converter="#{messageConverter}" sortable="false"/>
                  	<rg:column property="activeTime" title="最近活跃时间" converter="#{dateConverter}" datePattern="yyyy-MM-dd"/>
<!--                  	<rg:column title="最近回访日期" sortable="false"/>-->
<!--                  	<rg:column title="订单到期时间" sortable="false"/>-->
                   <rg:column cellType="oper"
                                title="#{messages.crud_tbl_operate_label}" width="220">
                                <ul class="links">
								<li><h:outputLink
										value="/luyuan/member/detailUser.jsf?memberId=#{entity.id}"
										onclick="UI.instance.showMask();">会员信息</h:outputLink></li>
								<li><h:outputLink value="#"
										onclick="UI.instance.showDialog({id:'add', src:'/luyuan/member/sendSms.jsf?memberId=#{entity.id}'});">发送短信</h:outputLink>
								</li>
							</ul>
                 </rg:column>
            </rg:table>
			</h:panelGroup>
		</rg:areaPanel>
		</h:form> 
		<a:form>
			<a:jsFunction name="reRenderMemberTale" reRender="userTableGroup"/>
		</a:form>
	</ui:define>

</ui:composition>